Repository navigation
feat(files): a lastTouchedBefore cutoff for cleaning up recent files - #437
Conversation
commit: |
|
@ianmacartney want your read on direction here. The 24-hour grace period is the only thing reserving a file between
None is safe for a file stored before the cutoff whose message isn't saved yet, so it's documented as reset-only, which is the case in #361. The root fix would be reserving the file under its pending message so cleanup needs no grace period at all. |
8bc1791 to
c3d7396
Compare
c3d7396 to
e85f6e3
Compare
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
86d808c to
5e36f03
Compare
ianmacartney
left a comment
There was a problem hiding this comment.
lgtm. we can always revisit and keep this as a deprecated option if the need arises
…teFiles (#361) Passing the same cutoff to both cleans up recent unreferenced files, such as in a dev reset, while keeping any file used at or after it.
5e36f03 to
1a058a4
Compare
Closes #361.
getFilesToDeleteanddeleteFilestake an optionallastTouchedBefore(ms since epoch) in place of the fixedDate.now() - 24h. Passing the same cutoff to both keeps any file used at or after it, and files with a reference are always kept. NaN and future cutoffs are rejected, since a future one would delete a file reused between listing and deleting.forceis unchanged.Only for resets: files from before the cutoff that aren't in a saved message yet (uploads, or a running generation's files) are deleted too, since the grace period is what reserves them until then.